<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="../plugin/jquery-3.5.1.js"></script>
    <script>
        var arr = [ 4, "Pete", 8, "John" ];

        var index = $.inArray("John", arr);  

        var index2 = $.inArray("lx", arr);  

        console.log(index)
        console.log(index2)
    </script>
</body>
</html>